<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/style1.css">
	
	 <script type="text/javascript">
		    function check(){
		    	if(loginform.username.value==""){
		    		alert("用户名不能为空!");
		    		loginform.username.focus();
		    		return false;
		   	 }
		   
		    if(loginform.password.value==""){
			    alert("密码不能为空!");
			    loginform.password.focus();
			    return false;
			 }
			if(loginform.password.value.length<4){
			    alert("密码长度不能小于4位!");
			    loginform.password.focus();
			    return false;
			}
			
			    loginform.submit();
			}
    </script>
  </head>
  
  <body id="loginbody">
    <div id="login">
    		<form action="loginAction.jsp" name="loginform" method="post">
			    <table >
			    	
			    	<!-- 表格第一行 -->
			    	<tr>
			    		<td>用户名:</td>
			    		<td><input type="text" name="username" size="20"></td>
			    	</tr>
			    	<!-- 表格第二行 -->
			    	<tr>
			    		<td>密&nbsp;&nbsp;码:</td>
			    		<td><input type="password" name="password" size="21"></td>
			    	</tr>
			    	<!-- 表格第三行 -->
			    	<tr>
			    		<td colspan="2">
			    			<input type="radio" name="role" value="1" checked>管理员
			    			<input type="radio" name="role" value="2" >教师
			    			<input type="radio" name="role" value="3" >学生
			    		</td>
			    		
			    	</tr>
			    	<!-- 表格第四行 -->
			    	<tr>
			    		<td><input type="button"  value="登录" onClick="check()"></td>
			    		<td align="center"><input type="reset" name="cancle" value="取消"></td>
			    	</tr>
			    	<!-- 表格第五行 -->
			    	  	
			    </table>
  		</form>
 
  </body>
</html>
